package com.sun.service.impl;

import com.sun.entity.Reader;
import com.sun.mapper.ReaderMapper;
import com.sun.service.ReaderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author SunRui
 * @description TODO
 * @date 2024/8/10 22:29
 */
@Service
public class ReaderServiceImpl implements ReaderService {
    @Autowired
    private ReaderMapper readerMapper;
    @Override
    public Reader login(String email, String pwd) {
        return readerMapper.login(email,pwd);
    }

    @Override
    public int updateMoney(float money, int id) {
        return readerMapper.updateMoney(money, id);
    }

    @Override
    public int updatePwd(int id, String pwd) {
        return readerMapper.updatePwd(id, pwd);
    }

    @Override
    public int topUpMoney(String email, float money) {
        return readerMapper.topUpMoney(email, money);
    }

    @Override
    public int addReader(Reader reader) {
        return readerMapper.addReader(reader);
    }

    @Override
    public int selectBorrowSum(int id) {
        return readerMapper.selectBorrowSum(id);
    }

    @Override
    public int deductBorrowSum(int id, int borrowSums) {
        return readerMapper.deductBorrowSum(id, borrowSums);
    }

    @Override
    public int addBorrowSum(int id, int borrowSums) {
        return readerMapper.addBorrowSum(id, borrowSums);
    }
}
